replaced a few well placed functions :P