added the from scratch version of improvedtwo JS