A tiny heat engine is modeled as a Brownian particle in a sawtooth potential (with or without load) moving through a highly viscous medium driven by the thermal kick it gets from alternately placed hot and cold heat reservoirs. We found closed form expression for the current as a function of the parameters characterizing the model. Depending on the values these model parameters take, the engine is also found to function as a refrigerator. Expressions for the efficiency as well as for the refrigerator coefficient of performance (COP) are also reported. Study of how these quantities depend on the model parameters enabled us in identifying the points in the parameter space where the engine performs with maximum power and with optimized efficiency. The corresponding efficiencies of the engine are then compared with those of the endoreversible and Carnot engines.