finaly fixed output