adjusting implementations and fixing some issues