cleaned up to comply with coding standards