bug tested version. Possible final version unless I have time to add more features.