STY ENH: Adding timeout and PEP8 changes