Updated moon variable in algorithm