found the bugs now just need to implement it