finished grammar rules although likely to break if anything drastic changes in the target file, started logic