fixed bugs with code
fixed various stuff