beginning simulator conversion
Written in PHP but will convert to JS
db update