Changed loops to list comprehensions and added format specifier in GridHandler