added a few needed functions, but this is still far from functional