Cleaned up how it works