drawing logic updated