Cleaned up new code