almost done with reimplementing & bugs