adding commenting, fixed warnings