accomplished little refactoring and and added snake length