fixed class inheritance bug, added mapping functions