more features added as per joe's request