Pred function is now implemented, dealt with a strage bug in size_t variables. They are now int