fixed more stupid mistakes; condensed functions work now