fixed errors, full functional now