Fixed #17, updated method extend class