Added Login and Refactored Code Base somewhat