Fixed syntactical bugs in lib.py. Not working right