Shortened the functions. 
TODO: 
1. stuff in his feedback 
2. (maybe) move helper function into a new file.