Merged 3 more solutions with refactoring. Added some functions and refactored some for reusability. Cleaned Python 2 functions.