Cleaned up code, reduced lines of code