main operation needs work