Cleaned up code (more)