removed commenting, added credit to author of original script