Cleaned up some code, fixed spacing issues, fixed bug in selection