Added classes, inheritance in js