^Defendant, Byron Bradley, appeals his conviction and sentence for unauthorized entry of an inhabited dwelling. For the reasons that follow, we affirm his conviction and sentence.
STATEMENT OF THE CASE
On July 16, 2009, the Jefferson Parish Grand Jury returned an indictment charging defendant with aggravated rape, in violation of LSA-R.S. 14:42 (count one), and aggravated burglary, in violation of LSA-R.S. 14:60 (count two). At his arraignment, defendant pled not guilty. The matter thereafter proceeded to trial before a twelve-person jury. After considering the evidence presented, the jury, on July 16, 2011, found defendant not guilty on count one and guilty of unauthorized entry of an inhabited dwelling on count two. On July 28, 2012, the trial court sentenced defendant to imprisonment at hard labor for six years on count two. Defendant now appeals.
J¿FACTS
Defendant and L.W. got married on January 19, 2002, and according to L.W., the two had a tumultuous relationship.1 *989As a result of defendant’s drug addiction and their marital problems, L.W., in the latter part of 2008, asked defendant to leave her house on Keithway Drive in Harvey. At some point he complied with her request and went to stay at his mother’s house. While at his mother’s house, defendant wrote several letters to the -victim expressing his desire to reconcile. However, the two did not reconcile; in fact, the victim took defendant’s house key away from him. According to L.W., even after she took the key away, defendant still showed up at the house without her permission and would gain entry through the back door. One such visit occurred on March 15, 2009.
On that day, between 7:00 and 7:30 a.m., L.W. was asleep in her house when she was awakened by a noise in the hallway. She jumped up and saw defendant standing in the bedroom. L.W. described defendant as being “out of it ... like he was just coming off a high or something.” L.W. told defendant that she had to go to work; however, defendant, who had a knife in his hand, told her “to shut up and to lay down.” She complied because she was scared, but she screamed and asked defendant “not to do it.” At some point defendant put the knife on the nightstand. He then removed L.W.’s underwear, got on top of her, put his penis into her vagina, and ejaculated. Defendant told L.W. to take a shower, but she refused, saying that she had to go to work. He gave her a towel, and she wiped |4herself off and threw the towel on the floor. L.W. subsequently put her clothes on, got in her car, and left. However, shortly thereafter, she returned home and called the police. Upon their arrival, L.W., who was distraught and visibly upset, told them that defendant had broken into her house through the back patio door and had raped her.
At trial, defendant testified on his own behalf and presented a different version of events. According to defendant, on March 15, 2009, he entered the Keithway residence through the back door and proceeded to the kitchen to fix something to eat. While he was in the kitchen, L.W., who did not know defendant was coming over, came downstairs. Following a brief conversation, the two went upstairs and had consensual sex. Defendant and L.W. then got into an argument about her car. She subsequently called the police and reported the alleged rape to them.
ASSIGNMENT OF ERROR NUMBER ONE
In his first assigned error, defendant challenges the sufficiency of the evidence used to convict him of unauthorized entry of an inhabited dwelling.
In reviewing the sufficiency of evidence pursuant to the standard set forth in Jackson v. Virginia, 443 U.S. 307, 99 S.Ct. 2781, 61 L.Ed.2d 560 (1979), an appellate court must determine whether the evidence, either direct or circumstantial, or a mixture of both, viewed in the light most favorable to the prosecution, was sufficient to convince a rational trier of fact that all of the elements of the crime have been proven beyond a reasonable doubt. State v. Neal, 00-0674 (La.6/29/01), 796 So.2d 649, 657, cert. denied, 535 U.S. 940, 122 S.Ct. 1323, 152 L.Ed.2d 231 (2002); State v. Lawson, 08-123 (La.App. 5 Cir. 11/12/08), 1 So.3d 516, 522.
| ^Defendant was charged with aggravated burglary, but convicted of unauthorized entry of an inhabited dwelling, *990which is defined by LSA-R.S. 14:62.3(A) as “the intentional entry by a person without authorization into any inhabited dwelling or other structure belonging to another and used in whole or in part as a home or place of abode by a person.” An unauthorized entry is an entry without consent, express or implied. State v. Rivet, 01-353 (La.App. 5 Cir. 9/25/01), 798 So.2d 219, 224. In the case of a private residence, a person must have the consent of the occupant or an occupant’s agent to constitute a defense to unauthorized entry. This consent must be given by a person with authority or capacity to consent. State v. Kirsch, 04-214 (La.App. 5 Cir. 7/27/04), 880 So.2d 890, 894.
In the instant case, defendant contends that the State failed to show that he entered a residence that belonged to another person or that the entry was unauthorized. Defendant asserts that the residence he entered was the one he shared with his wife and that even though his wife took his key from him and her name was the only one on the act of sale, the house belonged to both of them and he had the right to be there.
Similar arguments have been rejected by appellate courts in this state with respect to burglary charges, which also include the element of unauthorized entry. In State v. Williams, 93-353 (La.App. 1 Cir. 12/29/93), 632 So.2d 351, writ denied, 94-1009 (La.9/2/94), 643 So.2d 139, defendant and his wife lived at a residence which was his wife’s separate property. His wife paid for the residence and was responsible for its upkeep. At some point defendant moved out of the residence and relinquished the house keys to her, stating his intention to not return. Nevertheless, defendant came back to her home on numerous occasions, and each time, his wife would call the police. About three days prior to the charged |f,offenses, defendant went to his wife’s home, entered the home with a key she did not know he had, and raped her. She then changed the locks on the door, and defendant returned again. Defendant’s wife subsequently completed paperwork for a temporary restraining order against defendant. When he learned of this, defendant returned and broke into the house. When she saw defendant inside her house, she tried to call the police, but her phone was not working. Defendant then beat, raped, and sexually assaulted his wife. He was later convicted of aggravated rape, aggravated burglary, and aggravated crime against nature.
On appeal, defendant contended that the evidence was insufficient to support the aggravated burglary conviction because the State failed to prove that there was an unauthorized entry of the residence. Defendant asserted that because he and his wife lived at the residence until they physically separated about two months prior to the offenses in question, there was no unauthorized entry. The appellate court rejected defendant’s argument and found that defendant’s conviction of aggravated burglary was supported by the evidence. In so ruling, the Court noted that the residence was the victim’s separate property, she paid for the residence and was responsible for its upkeep, the victim never sought reconciliation with defendant, and defendant surrendered his keys to the residence stating his intention to not return. State v. Williams, 632 So.2d at 357-58.
Likewise, in State v. Monley, 557 So.2d 319 (La.App. 4 Cir.1990), defendant and the victim lived together until the victim took defendant’s house key away from him. They were later married but never lived together after the marriage. Although defendant came to her house many times to visit their children, she had told him not to come in the early morning or *991late at night. At some point defendant broke through the front door of the victim’s house and hit her. He then forced her into his car, drove to another area, and raped her. The jury | 7found defendant guilty of aggravated burglary. On appeal, defendant argued that the State failed to prove his entry into the victim’s residence was unauthorized based on the fact that they were legally married, that he visited his children regularly, and that he had a proprietary and community interest in the home. The appellate court found that the evidence was sufficient to support the conviction, noting that defendant did not reside at the residence, and the victim did not give defendant permission to enter her home. State v. Monley, 557 So.2d at 320-21.
Also, in State v. Woods, 526 So.2d 443 (La.App. 4 Cir.1988), defendant and the victim were still married, but estranged. The victim had moved to another apartment, which was listed in her name and that of another man. The defendant broke into her apartment. On appeal, defendant contended that the evidence was insufficient to sustain his simple burglary conviction because he and the victim were still married, and she was using community funds to pay the rent, thus making the apartment a “community dwelling” over which he had a proprietary interest. The Fourth Circuit rejected defendant’s argument, finding that because the apartment was not in defendant’s name and defendant did not contribute to the rent, it was not a community dwelling, and he did not have a proprietary interest which would have allowed him authority to enter the apartment.
In the instant case, L.W. testified that she purchased the Keithway residence in 2001 before she and defendant were married in 2002, that the mortgage on the Keithway residence was in her name, and that she was responsible for making all of the mortgage payments. Although defendant and the victim lived together in the residence after they were married, the victim told defendant to leave several months prior to the incident due to their marital problems. The victim took defendant’s house key away from him, and defendant went to live with his mother. Even though defendant no longer had house keys, he continued to go to the |sresidence and would normally enter through the back patio door. At the time of the incident, the victim was in the process of getting a peace bond to keep defendant out of the home.
In addition to the victim’s testimony, the State also presented the testimony of Deputy Michael Burgess and Detective Gary Barteet who responded to the victim’s call on March 15, 2009. Officer Burgess testified that when he arrived at the scene, L.W., who was visibly upset and distraught, advised him that her husband or ex-husband had come into the house uninvited and that he had forced his way in through the back patio doors. Detective Barteet testified that he saw tool marks on the back door area and markings along the locking mechanism “consistent with something being pried.” According to the detective, it appeared that “something had been wedged in between, allowing the door to open.” Further, Detective Barteet testified that when he asked defendant for his address, defendant initially gave the Keith-way address. However, when the detective asked defendant if that was where he was physically staying, defendant answered negatively and said that he was staying at his mother’s home on South White Street.
In contrast to this testimony, defendant testified that the Keithway residence was purchased in L.W.’s name because he had financial problems and bad credit at the *992time. However, he insisted that they decided to purchase the house together and that he did additional work on the house after they bought it. Defendant asserted that the Keithway residence was his home and that he had a key and came and went freely. He admitted that there was a time when he did not have a key, but he still came and went through the patio door. He testified that he always felt he had permission to be there. During his testimony, defendant admitted that L.W. was responsible for the mortgage, that she paid most of the bills, and that, for the most part, she provided for him.
|flThe jury heard the evidence presented at trial, and by its verdict of guilty, obviously accepted the testimony of the State witnesses that defendant’s entry was unauthorized. The credibility of witnesses is within the sound discretion of the trier of fact, who may accept or reject, in whole or in part, the testimony of any witness; the credibility of witnesses will not be reweighed on appeal. State v. Rowan, 97-21 (La.App. 5 Cir. 4/29/97), 694 So.2d 1052, 1056.
Viewing the evidence presented at trial in the light most favorable to the prosecution, we find that a rational trier of fact could have concluded, beyond a reasonable doubt, that defendant was guilty of unauthorized entry of an inhabited dwelling. Accordingly, this assigned error is without merit.
ASSIGNMENT OF ERROR NUMBER TWO
In this assigned error, defendant challenges the sentence imposed as constitutionally excessive. Defendant was convicted of unauthorized entry of an inhabited dwelling and received the maximum sentence of six years at hard labor.2
He now contends that this sentence was not justified and points out that the trial court failed to consider various mitigating circumstances. In particular, defendant contends that the trial court failed to consider that he was acquitted of a previous forcible rape charge as well as the instant aggravated rape charge and that he was accused by two women who simply felt betrayed. Defendant further points out that he was gainfully employed, the residence he was accused of entering without authorization was the residence where he lived with his wife, there were no pending restraining orders against him at the time of the incident, and he was told on a previous occasion by a police officer that he had the right to be in the house and could not be forced to leave.
|10The Eighth Amendment to the United States Constitution and Article I, § 20 of the Louisiana Constitution prohibit the imposition of excessive punishment. A sentence is considered excessive, even when it is within the applicable statutory range, if it is grossly disproportionate to the offense or imposes needless and purposeless pain and suffering. State v. Warmack, 07-311 (La.App. 5 Cir. 11/27/07), 973 So.2d 104, 109. In reviewing a sentence for excessiveness, the appellate court must consider the punishment and the crime in light of the harm to society and gauge whether the penalty is so disproportionate as to shock the court’s sense of justice. The trial judge is afforded wide discretion in determining sentences, and the court of appeal will not set aside a sentence for excessiveness if the record supports the sentence imposed. State v. Berry, 08-151 (La.App. 5 Cir. 6/19/08), 989 *993So.2d 120, 131, writ denied, 08-1660 (La.4/3/09), 6 So.3d 767.
In reviewing a trial court’s sentencing discretion, three factors are considered: 1) the nature of the crime; 2) the nature and background of the offender; and 3) the sentence imposed for similar crimes by the same court and other courts. State v. Pearson, 07-332 (La.App. 5 Cir. 12/27/07), 975 So.2d 646, 656. A trial judge is not limited to considering only prior convictions and may review all evidence of prior criminal activity, including evidence of prior arrest records and of uncharged offenses or offenses that were nolle prossed. State v. Mason, 10-284 (La.App. 5 Cir. 1/11/11), 59 So.3d 419, 429, writ denied, 11-306 (La.6/24/11), 64 So.3d 216.
In the present case, prior to imposing sentence, the trial court considered the victim impact statement provided by L.W. Further, the trial court considered the sentencing guidelines and found that there was an undue risk during any suspended sentence or probation that defendant would commit another crime based upon his history. The trial judge further noted that defendant was in need of eor-rectional |n treatment in a custodial environment that could be provided most effectively by his commitment to an institution and that a lesser sentence would deprecate the seriousness of defendant’s crime. The trial judge also commented that he had heard the evidence and the testimony, that he was aware of defendant’s history, and that he believed it was appropriate to sentence defendant to six years at hard labor. Moreover, when he denied defendant’s motion for reconsideration of sentence, the trial court stated that he wished he could give defendant more time, and that it was unfortunate that the Legislature had only given the court the discretion to give defendant six years.
We acknowledge that maximum sentences are reserved for the most serious violations and the worst offenders. State v. Farhood, 02-490 (La.App. 5 Cir. 3/25/03), 844 So.2d 217, 225. However, a review of the jurisprudence establishes that Louisiana courts have upheld similar sentences for similarly situated defendants.
In State v. Jupiter, 06-93 (La.App. 5 Cir. 6/28/06), 934 So.2d 884, defendant kicked in the door of his girlfriend’s apartment, entered it without her permission, struck her, and then fled. He was convicted of unauthorized entry of an inhabited dwelling, among other things, and sentenced to six years imprisonment at hard labor. On appeal, defendant contended that he was not the most egregious of offenders, and that this incident involved a family argument that escalated. This Court upheld the sentence, noting that defendant was charged with numerous other crimes in connection with this case.
Likewise, in State v. Williams, 32,993 (La.App. 2 Cir. 3/1/00), 754 So.2d 418, cited approvingly by this Court in Jupiter, defendant went to his girlfriend’s apartment, kicked the door in, entered, and physically restrained his girlfriend. The Second Circuit found that sentencing defendant to five years at hard labor for | ^unauthorized entry of an inhabited dwelling was not constitutionally excessive, noting that the trial court concluded that defendant was in need of correctional treatment and a lesser sentence would deprecate the seriousness of the offense.
Also, in State v. Butler, 06-645 (La.App. 5 Cir. 12/27/06), 948 So.2d 296, this Court upheld a five-year hard labor sentence for a defendant who was convicted of unauthorized entry of an inhabited dwelling, noting that defendant entered his girlfriend’s home despite a restraining order and with*994out her authorization, confronted her with a knife, and left only because she called the police. This Court further noted that the restraining order and supporting documents showed that the defendant had a propensity toward violence to the victim, and that defendant had a similar conviction in another state.
Having considered the circumstances of the crime, the nature and background of the offender, and sentences imposed for similar crimes, we find that the six-year sentence imposed on defendant was not constitutionally excessive. The record shows that defendant and L.W. had marital problems, after which L.W. told defendant to leave her house and relinquish his house key. At the time of the incident, she was attempting to obtain a peace bond to keep defendant out of her home. Nevertheless, defendant broke into his wife’s home through the back patio doors uninvited and without authorization on numerous occasions. Additionally, defendant has a criminal history. He admitted he had a drug problem, and that he had prior convictions for obscenity and unauthorized entry of a business and a prior arrest for rape. Moreover, the jurisprudence supports the maximum sentence imposed.
Based on the foregoing, we find that the sentence imposed is not excessive and further that the trial court did not abuse its discretion in imposing the |ismaximum term of imprisonment in this matter. Accordingly, this assigned error is without merit.
ERROR PATENT REVIEW
We have also reviewed the record for errors patent, in accordance with LSA-C.Cr.P. art. 920; State v. Oliveaux, 312 So.2d 387 (La.1975); and State v. Weiland, 556 So.2d 175 (La.App. 5 Cir.1990). Our review reveals no errors patent.
Accordingly, for the reasons set forth herein, we affirm defendant’s conviction and sentence.
CONVICTION AND SENTENCE AFFIRMED
. The victim's initials, and those of certain family members, are used under the authority of LSA-R.S. 46:1844(W)(3), which allows the court to protect the victim of a sex offense by *989using his or her initials. See State v. Greene, 06-667 (La.App. 5 Cir. 1/30/07), 951 So.2d 1226, 1229, writ denied, 07-0546 (La.10/26/07), 966 So.2d 571.
. LSA-R.S. 14:62.3(B) provides as follows:
"Whoever commits the crime of unauthorized entry of an inhabited dwelling shall be fined not more than one thousand dollars or imprisoned with or without hard labor for not more than six years, or both.”