bugs fixed, works