Not perfect but got the job done