Cleaned up code
stupid implementations first