added comments
updated databse functions to be more secure
fixed syntax error
fixed db bug
updated app to be able to set the number of blocks