refactored variables / worked on moonAPI func