updated code for Abstract class