working stuff except the complete function