Fixed bug for variables being declared in the wrong order. Using LinkedHashMap instead of HashMap for correct order.