Reverted formatting reduce differences with original version (will be done later)
Fixed js bug removed curly brace possible created by merging