Back to the point where we were yesterday, except the code is MUCH cleaner and functions better