Merged the other bits n pieces to help reduce the complexity of the solution