cleaning up the mag map js