initial code accomplished in an hour; to be updated soon