Cleaned up code
- Fixed styles
- Made code return an error
- Added parameters