Added infinite loop checking in rotate()
Set .gitignore to include VIM swap files