cleaned up warnings and add commenting