Cleaned up code + comments