added bug fixes Ive added to the advanced version