Replaced code with my updated version

Thanks for the jumping point, Tolgaek!