Cleaned up syntax and added comments