The important thing to remember when learning a piece is that the most important thing to do is begin and end well. When trying to memorize a piece (particularly piano or guitar) it can be really beneficial to start learning the piece "backwards". What I mean by this is go to the end of the piece and just play the last 8 bars a few times, then try to play the last 16, etc... this should anchor the ending as strongly as the beginning inevitably winds up being in the mind/finger memory of the musician...it can really help alot, particularly if you have trouble remembering only the final parts of the pieces.