added options html and javascript frontendy logic