Cleaned up ga code