Implemented xoft's suggestions again