finished algorithm in atom for parks