proper python code written