Cleaned up init and added some new functions