Implemented suggestions by calebthompson.