solving paperclip path problem