updated to fork from nickstenning